package com.umakr.ax.app.web;

import java.util.Map;

import com.umakr.ax.common.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import com.umakr.ax.common.model.Code;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import com.umakr.ax.core.base.AbstractController;

/**
 * <p>
 * 编码表  前端控制器
 * </p>
 *
 * @author Umakr-Code-Generator
 * @since 2017-12-30
 */
@Controller
@RequestMapping("/api/web/code")
public class CodeWebController extends AbstractController {
	@Autowired
	CodeService codeService;

	@ApiOperation(value = "根据编码typeName查询编码表 返回单个值")
	@GetMapping(value = "/getCodeByTypeName")
	public Object getCodeByTypeName(ModelMap modelMap, @RequestParam(name = "typeName") String typeName) {
		return setSuccessModelMap(modelMap,codeService.getCodeByTypeName(typeName));
	}


}